<?php 
namespace app\my\controller;
use app\my\service\AttentionService;
use think\Request;
use think\facade\Log;
/**
 * @title 关注
 * @description 关注
* @group 我的
 */

class Attention extends AttentionService
{
	
	function __construct()
	{
		parent::__construct();
	}

	/**
     * @title 关注用户
     * @description 关注用户
     * @author 凌杰
     * @url /my/attention/attention_user
     * @param name:mutualOpenid type:string require:0 default:1 other: desc:关注用户的Openid
     * @param name:passOpenid type:string require:0 default:1 other: desc:被关注的用户Openid
     * @method POST
     * @return code:错误码
     * @return msg:错误消息
     */
    public function attention_user(Request $request)
    {
        if(!$request->isPost()) return False;
        $info = $request->param();
        $res = $this->attention_users($info);
        return json($res);
    }


    	/**
     * @title 取消关注
     * @description 取消关注
     * @author 凌杰
     * @url /my/attention/attention_cancel
     * @param name:mutualOpenid type:string require:0 default:1 other: desc:用户的Openid
     * @param name:passOpenid type:string require:0 default:1 other: desc:被取消的用户Openid
     * @method POST
     * @return code:错误码
     * @return msg:错误消息
     */
    public function attention_cancel(Request $request)
    {
        if(!$request->isPost()) return False;
        $info = $request->param();
        $res = $this->attention_cancels($info);
        return json($res);
    }

      	/**
     * @title 关注列表
     * @description 关注列表
     * @author 凌杰
     * @url /my/attention/list
     * @param name:Openid type:string require:0 default:1 other: desc:用户的Openid
     * @param name:Usernickname type:string require:0 default:1 other: desc:用户昵称
     * @param name:page type:int require:0 default:1 other: desc:页数
     * @method POST
     * @return code:错误码
     * @return msg:错误消息
     * @return data:关注列表@
     * @data Userimg:用户头像 Usernickname:用户名称 Userid:用户id Openid:Openid isMuAttention:1普通关注 2相互关注
     */
    public function list(Request $request)
    {
        if(!$request->isPost()) return False;
        $info = $request->param();
        $res = $this->lists($info);
        return json($res);
    }


       /**
     * @title 是否关注
     * @description 是否关注
     * @author 凌杰
     * @url /my/attention/isattention
     * @param name:mutualOpenid type:string require:0 default:1 other: desc:主用户的Openid
     * @param name:passOpenid type:string require:0 default:1 other: desc:被关注用户的Openid
     * @method POST
     * @return code:错误码 200 未关注 其他 已关注
     * @return msg:错误消息
     */
    public function isattention(Request $request)
    {
        if(!$request->isPost()) return False;
        $info = $request->param();
        $res = $this->isattentions($info);
        return json($res);
    }
}